<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- 下拉框 -->
    <link rel="stylesheet" href="static/ace/css/chosen.css"/>
    <!-- jsp文件头和头部 -->
    <%@ include file="../base/top.jsp"%>
    <!-- 日期框 -->
    <link rel="stylesheet" href="static/ace/css/datepicker.css"/>
</head>
<body class="no-skin">
<div class="main-container" id="main-container">
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <%--<input id="success" style="display: none"/>--%>
                        <%--<input id="talent-training-programId" style="display: none"/>--%>
                        <%--<input id="old-file-address" style="display: none"/>--%>
                        <input type="text" name="success" id="success" style="display: none"/>
                        <input type="text" name="msg" id="msg" style="display: none"/>
                        <form  id="talent-form">
                            <table id="table_report" class="table table-striped table-bordered table-hover">
                                <tr>
                                    <td style="width:79px;text-align: right;padding-top: 13px;">作&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;业:</td>
                                    <td>
                                        <div class="fileQ313596790Qfile"></div>
                                        <input type="file" id="file" name="file" />
                                        <div class="fileQ313596790Qfile"></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="text-align: center;" colspan="10">
                                        <a class="btn btn-mini btn-primary" onclick="save();">上传</a>
                                        <a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
                                    </td>
                                </tr>
                            </table>
                        </form>
                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </div>
            <!-- /.page-content -->
        </div>
    </div>
    <!-- /.main-content -->
</div>
<!-- /.main-container -->

<script src="static/ace/js/ace/elements.fileinput.js"></script>

<%@ include file="../base/foot.jsp" %>

<script type="text/javascript">
    $(top.hangge());//关闭加载状态
    $(function() {
        //上传
        $('#file').ace_file_input({
            no_file:'上传流程作业 ',
            btn_choose:'选择',
            btn_change:'更改',
            droppable:false,
            onchange:null,
            thumbnail:false, //| true | large
            whitelist:'*',
        });
    });

    function save() {
        var data = new FormData(document.getElementById("talent-form"));
        $.ajax({
            type:"POST",
            url:"<%= basePath%>assignment/uploadMyAssignment",
            data:data,
            processData:false,
            contentType:false,
            success:function (data) {
                $("#success").val(data["success"]);
                $("#msg").val(data["msg"]);
                //关闭一定要写在ajax执行完成之后
                top.Dialog.close();
            }
        })
    }
</script>
</body>
</html>
